import { BasicColumn, FormSchema } from '@apps/antd-admin/src/components/Table';
import { render } from '@apps/antd-admin/src/hooks/render/renderUtils';
export const columns: BasicColumn[] = [
  {
    title: '服务图标',
    dataIndex: 'serverIcon',
    width: 120,
    customRender: render.renderImage,
  },
  {
    title: '服务名称',
    dataIndex: 'serverName',
    width: 200,
  },
];

export const searchFormSchema: FormSchema[] = [];

export const formSchema: FormSchema[] = [
  {
    label: '主键',
    field: 'viprsId',
    component: 'Input',
    required: false,
    show: false,
  },
  {
    label: '贵宾厅Id',
    field: 'viproomId',
    component: 'Input',
    required: false,
    show: false,
  },
  {
    label: '服务',
    field: 'viproomServerId',
    component: 'ApiModalSelect',
    required: true,
    componentProps: {
      multiple: '',
      selectConfig: {
        api: '/viproomserver/list',
        rowKey: 'viproomServerId',
        labelKey: 'serverName',
        modalTitle: '服务选择',
        searchForm: [
          {
            label: '服务名称',
            field: 'serverName',
            component: 'Input',
          },
        ],
        columns: [
          {
            title: '服务图标',
            dataIndex: 'serverIcon',
            width: 80,
            customRender: render.renderImage,
          },
          {
            title: '服务名称',
            dataIndex: 'serverName',
            width: 80,
          },
        ],
      },
    },
  },
];
